<?php
namespace app\index\controller;

use houdunwang\arr\Arr;
use think\Controller;

/**
 * Class Index
 * @package app\index\controller
 * 前台首页控制器
 */
class Index extends Controller
{
    //首页
    public function index()
    {
        p(session('index'));
        //处理title
        $conf = ['title'=>'阿里巴巴1688.com - 全球领先的采购批发平台,批发网','css'=>'index','js'=>'index'];
        $this->assign('conf',$conf);
        //获取分类数据
        $cateData = db('category')->select();
        $arrData = Arr::channelLevel($cateData);
        $this->assign('arrData',$arrData);
        //获取商品
        $goodsData = db('goods')->select();
        $this->assign('goodsData',$goodsData);
        return view();
    }
}
